home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_aet_escape.cog < prev    next >
Text File  |  1999-11-15  |  15KB  |  538 lines

  1. # Jones 3D Cog Script
  2. #
  3. # aet_Escape.cog
  4. #
  5. # [TL]
  6. #
  7. # (C) 1999 LucasArts Entertainment Co. All Rights Reserved
  8. # ========================================================================================
  9. symbols
  10.  
  11. message     startup
  12. message        user0
  13. message        user1
  14. message     pulse
  15. message        crossed
  16. message        entered
  17. message        timer
  18.  
  19. thing        player                                local            
  20. thing        por                                                # (temp)
  21.  
  22. surface        trigger0                                        # Trigger adjoin for first colomn crash.
  23. surface        trigger1                                        # Trigger adjoin for right after the steps.
  24. surface        trigger2                                        # Trigger adjoin for first block.
  25. surface        trigger3                                        # Trigger for second block in first room.
  26. surface        trigger4                                        # Trigger for debris at stair jump.
  27. surface        trigger5                                        # Trigger for debris at begining of huge room.
  28. surface        trigger6                                        # Trigger for debris at middle of huge room.
  29. surface        trigger7                                        # Trigger for debris at second middle of huge room.
  30. surface        trigger8                                        # Trigger for debris at last set of steps.        
  31.  
  32. surface        closeadjoin                                        # Adjoin to close off AET!
  33.  
  34. sector        finalTrigger                                    # Trigger to stop music and cog.
  35.  
  36. thing        stat_colmA                                        # Static colomn 3dos.
  37. thing        stat_colmB
  38. thing        stat_colmC
  39.  
  40. thing        mov_colmA                                        # Moving colomns for crashing down first room.
  41. thing        mov_colmB
  42. thing        mov_colmC
  43. thing        mov_colmD                                        # Colomns for begining of huge room.
  44. thing        mov_colmE
  45. thing        mov_colmF                                        # Colomns for middle of huge room.
  46. thing        mov_colmG
  47. thing        mov_colmH
  48. thing        mov_colmI                                        # Colomns for third section of huge room.
  49. thing        mov_colmJ
  50.  
  51. thing        blockA                                            # First regular block.
  52. thing        blockB                                            # Second regular block.
  53.  
  54. cog            debrisCogA                                        # Tim's debris cog.
  55. cog            debrisCogB                                        # Debris by itself after steps.
  56. cog            debrisCogC                                        # Debris with first regular block.
  57. cog            debrisCogD                                        # Debris with second regular block.
  58. cog            debrisCogE                                        # Debris by itself at stair jump hole.
  59. cog            debrisCogF                                        # Debris begining of huge room.
  60. cog            debrisCogG                                        # Debris middle of huge room.
  61. cog            debrisCogH                                        # Debris second middle of huge room.
  62. cog            debrisCogI                                        # Debris third middle of huge room.
  63. cog            debrisCogJ                                        # Debris last set of steps.
  64.  
  65. sound       sfx_Block=sol_block_crash_c.wav     local       # Landing blocks sound.
  66. #sound        musicA=mus_enddemo.wav                local        # Looping music for escape.
  67. sound        musicB=mus_nub_annubisarm.wav        local        # Looping music for escape.
  68. sound       sndFalling=gen_falling_debris_c.wav local       # Falling rocks.
  69.  
  70. int         vibe                                local        # Int for random number of shakes.
  71. int            shake                                local        # Int for the amount of shake.
  72. int            goodToGo=0                            local        # Makes sure that it is time to begin escape.
  73. int            timerGo=0                            local
  74. int            rumbleChannel                        local
  75. #int            musicChannelA                        local        # Music channel for stoping it at end.
  76.  
  77. flex        rumbleWait=5.0                        local
  78. flex        rumbleStop=1.0                        local
  79.  
  80. vector      posOffset                           local        
  81. vector      angOffset                           local
  82.  
  83. end
  84.  
  85. # ========================================================================================
  86. code
  87.  
  88. startup:
  89.  
  90. //SetThingFlags(por, 0x80000); # (temp)
  91.  
  92. player = GetLocalPlayerThing();
  93.  
  94. # Reset the adjoin to invisable.
  95. SetFaceGeoMode(closeadjoin,0);
  96.  
  97. # Hide mov_colmX to prep for escape later.
  98. SetThingFlags(mov_colmA, 0x80000);
  99. SetThingFlags(mov_colmB, 0x80000);
  100. SetThingFlags(mov_colmC, 0x80000);
  101.  
  102. # Give 3dos no collision.
  103. SetCollideType(mov_colmF, 0);
  104. SetCollideType(mov_colmG, 0);
  105. SetCollideType(mov_colmH, 0);
  106. SetCollideType(mov_colmI, 0);
  107. //SetCollideType(mov_colmJ, 0);
  108.  
  109. # Light Colomns et al.
  110. SetThingLight(mov_colmA, '0.3 0.3 0.3', 0.01, 0.1);
  111. SetThingLight(mov_colmB, '0.3 0.3 0.3', 0.01, 0.1);
  112. SetThingLight(mov_colmC, '0.3 0.3 0.3', 0.01, 0.1);
  113. SetThingLight(mov_colmD, '0.3 0.3 0.3', 0.01, 0.1);
  114. SetThingLight(mov_colmE, '0.3 0.3 0.3', 0.01, 0.1);
  115. SetThingLight(mov_colmF, '0.3 0.3 0.3', 0.01, 0.1);
  116. SetThingLight(mov_colmG, '0.3 0.3 0.3', 0.01, 0.1);
  117. SetThingLight(mov_colmH, '0.3 0.3 0.3', 0.01, 0.1);
  118. SetThingLight(mov_colmI, '0.3 0.3 0.3', 0.01, 0.1);
  119. SetThingLight(mov_colmJ, '0.3 0.3 0.3', 0.01, 0.1);
  120.  
  121. //call user0; # (temp)
  122. //call user1; # (temp)
  123.  
  124. return;
  125.     
  126. # ........................................................................................
  127. crossed:
  128.  
  129. # Make sure only player triggers this code.
  130. if (GetSourceRef() != player)
  131.     {
  132.     return;
  133.     }
  134. # Code for first colomn falling with debris.
  135. if ((GetSenderRef() == trigger0) && (goodToGo == 1))
  136.     {
  137.     goodToGo = 2;
  138.     # Start music.
  139.     //musicChannelA = PlaySoundLocal(musicA, 0.6, 0, 0x1, 0);
  140.     
  141.     # Turn electric whip off.
  142.     SetWhipElectric(0);
  143.  
  144.     # Turn on falling debris.
  145.     SendMessage(debrisCogA, user0);
  146.     SetPulse(0.1);
  147.     
  148.     # Drop move blocks.
  149.     MoveToFrame(mov_colmA, 1, 8.0);
  150.     Sleep(0.25);
  151.     PlaySoundThing(sfx_Block, mov_colmA, 1.0, 5.0, 10.0, 0);
  152.     MoveToFrame(mov_colmB, 1, 8.0);
  153.     Sleep(0.15);
  154.     
  155.     # Give 3dos collision back after they pass thru geometry.
  156.     //SetCollideType(mov_colmA, 3);
  157.     //SetCollideType(mov_colmB, 3);
  158.     //SetCollideType(mov_colmC, 3);
  159.     
  160.     # Turn off falling debris.
  161.     Sleep(4.0);
  162.     SendMessage(debrisCogA, user1);
  163.     SetPulse(0.0);
  164.     SetTimer(rumbleWait); # rumbleWait Code.
  165.     }
  166. # Code for falling debris right after steps and arch.
  167. if ((GetSenderRef() == trigger1) && (goodToGo == 2))
  168.     {
  169.     StopSound(rumbleChannel, 0); # rumbleWait Code.
  170.     SetPulse(0.0); # rumbleWait Code.
  171.     SetTimer(0); # rumbleWait Code.
  172.     goodToGo = 3;
  173.     
  174.     # Close off AET for good!
  175.     SetFaceGeoMode(closeadjoin,4);
  176.     ClearAdjoinFlags(closeadjoin, 2);
  177.  
  178.     # Turn on falling debris.
  179.     SendMessage(debrisCogB, user0);
  180.     SetPulse(0.1);
  181.     
  182.     # Turn off falling debris.
  183.     Sleep(4.0);
  184.     SendMessage(debrisCogB, user1);
  185.     SetPulse(0.0);
  186.     SetTimer(rumbleWait, 0); # rumbleWait Code.
  187.     }
  188. # Code for first regular block and some debris after first turn.
  189. if ((GetSenderRef() == trigger2) && (goodToGo == 3))
  190.     {
  191.     StopSound(rumbleChannel, 0); # rumbleWait Code.
  192.     SetPulse(0.0); # rumbleWait Code.
  193.     SetTimer(0); # rumbleWait Code.
  194.     goodToGo = 4;
  195.     # Turn on falling debris.
  196.     SendMessage(debrisCogC, user0);
  197.     SetPulse(0.1);
  198.     
  199.     # Drop move blocks.
  200.     MoveToFrame(blockA, 1, 8.0);
  201.     Sleep(0.25);
  202.     PlaySoundThing(sfx_Block, blockA, 1.0, 5.0, 10.0, 0);
  203.     
  204.     # Give 3dos collision back after they pass thru geometry.
  205.     SetCollideType(blockA, 3);
  206.     
  207.     # Turn off falling debris.
  208.     Sleep(4.0);
  209.     SendMessage(debrisCogC, user1);
  210.     SetPulse(0.0);
  211.     SetTimer(rumbleWait); # rumbleWait Code.
  212.     }
  213. # Code for second regular block and some debris inside first big room.
  214. if ((GetSenderRef() == trigger3) && (goodToGo == 4))
  215.     {
  216.     StopSound(rumbleChannel, 0); # rumbleWait Code.
  217.     SetPulse(0.0); # rumbleWait Code.
  218.     SetTimer(0); # rumbleWait Code.
  219.     goodToGo = 5;
  220.     # Turn on falling debris.
  221.     SendMessage(debrisCogD, user0);
  222.     SetPulse(0.1);
  223.     
  224.     # Drop move blocks.
  225.     MoveToFrame(blockB, 1, 8.0);
  226.     Sleep(0.25);
  227.     PlaySoundThing(sfx_Block, blockB, 1.0, 5.0, 10.0, 0);
  228.     
  229.     # Give 3dos collision back after they pass thru geometry.
  230.     SetCollideType(blockB, 3);
  231.     
  232.     # Turn off falling debris.
  233.     Sleep(4.0);
  234.     SendMessage(debrisCogD, user1);
  235.     SetPulse(0.0);
  236.     SetTimer(rumbleWait); # rumbleWait Code.
  237.     }
  238. # Code for falling debris at stair jump.
  239. if ((GetSenderRef() == trigger4) && (goodToGo == 5))
  240.     {
  241.     StopSound(rumbleChannel, 0); # rumbleWait Code.
  242.     SetPulse(0.0); # rumbleWait Code.
  243.     SetTimer(0); # rumbleWait Code.
  244.     goodToGo = 6;
  245.     # Turn on falling debris.
  246.     SendMessage(debrisCogE, user0);
  247.     SetPulse(0.1);
  248.     
  249.     # Turn off falling debris.
  250.     Sleep(4.0);
  251.     SendMessage(debrisCogE, user1);
  252.     SetPulse(0.0);
  253.     SetTimer(rumbleWait); # rumbleWait Code.
  254.     }
  255. # Code for begining of huge room.
  256. if ((GetSenderRef() == trigger5) && (goodToGo == 6))
  257.     {
  258.     StopSound(rumbleChannel, 0); # rumbleWait Code.
  259.     SetPulse(0.0); # rumbleWait Code.
  260.     SetTimer(0); # rumbleWait Code.
  261.     goodToGo = 7;
  262.     # Turn on falling debris.
  263.     SendMessage(debrisCogF, user0);
  264.     SetPulse(0.1);
  265.     
  266.     # Drop move blocks.
  267.     MoveToFrame(mov_colmD, 1, 8.0);
  268.     Sleep(0.25);
  269.     PlaySoundThing(sfx_Block, mov_colmD, 1.0, 5.0, 10.0, 0);
  270.     MoveToFrame(mov_colmE, 1, 8.0);
  271.     Sleep(0.15);
  272.     
  273.     # Turn off falling debris.
  274.     Sleep(4.0);
  275.     SendMessage(debrisCogF, user1);
  276.     SetPulse(0.0);
  277.     SetTimer(rumbleWait); # rumbleWait Code.
  278.     }
  279. # Code for falling debris at last set of stairs.
  280. if ((GetSenderRef() == trigger8) && (goodToGo == 9))
  281.     {
  282.     StopSound(rumbleChannel, 0); # rumbleWait Code.
  283.     SetPulse(0.0); # rumbleWait Code.
  284.     SetTimer(0); # rumbleWait Code.
  285.     goodToGo = 10;
  286.     # Turn on falling debris.
  287.     SendMessage(debrisCogJ, user0);
  288.     SetPulse(0.1);
  289.     
  290.     # Turn off falling debris.
  291.     Sleep(4.0);
  292.     SendMessage(debrisCogJ, user1);
  293.     SetPulse(0.0);
  294.     
  295.     Sleep(1.0);
  296.  
  297.     PlaySoundLocal(musicB, 1.0, 0, 0x0, 0);
  298.     SetTimer(15.0); # rumbleWait Code.
  299.     }
  300.  
  301. return;
  302.     
  303. # ........................................................................................
  304. entered:
  305.  
  306. # Make sure only player triggers this code.
  307. if (GetSourceRef() != player)
  308.     {
  309.     return;
  310.     }
  311. # Code for middle of huge room.
  312. if ((GetSenderRef() == trigger6) && (goodToGo == 7))
  313.     {
  314.     StopSound(rumbleChannel, 0); # rumbleWait Code.
  315.     SetPulse(0.0); # rumbleWait Code.
  316.     SetTimer(0); # rumbleWait Code.
  317.     goodToGo = 8;
  318.     # Turn on falling debris.
  319.     SendMessage(debrisCogG, user0);
  320.     SetPulse(0.1);
  321.     
  322.     # Turn on I collide for a bit.
  323.     SetCollideType(mov_colmI, 3);
  324.  
  325.     # Drop move blocks.
  326.     MoveToFrame(mov_colmF, 1, 8.0);
  327.     Sleep(0.25);
  328.     PlaySoundThing(sfx_Block, mov_colmF, 1.0, 5.0, 10.0, 0);
  329.     MoveToFrame(mov_colmG, 1, 8.0);
  330.     Sleep(0.15);
  331.     
  332.     # Give 3dos collision back after they pass thru geometry.
  333.     SetCollideType(mov_colmF, 3);
  334.     SetCollideType(mov_colmG, 3);
  335.     
  336.     # Turn off falling debris.
  337.     Sleep(4.0);
  338.     SendMessage(debrisCogG, user1);
  339.     SetPulse(0.0);
  340.     SetTimer(rumbleWait); # rumbleWait Code.
  341.     }
  342. # Code for middle of huge room.
  343. if ((GetSenderRef() == trigger7) && (goodToGo == 8))
  344.     {
  345.     StopSound(rumbleChannel, 0); # rumbleWait Code.
  346.     SetPulse(0.0); # rumbleWait Code.
  347.     SetTimer(0); # rumbleWait Code.
  348.     goodToGo = 9;
  349.     # Turn on falling debris.
  350.     SendMessage(debrisCogH, user0);
  351.     SetPulse(0.1);
  352.  
  353.     # Drop move blocks.
  354.     MoveToFrame(mov_colmH, 1, 8.0);
  355.     Sleep(0.25);
  356.     PlaySoundThing(sfx_Block, mov_colmH, 1.0, 5.0, 10.0, 0);
  357.     
  358.     # Give 3dos collision back after they pass thru geometry.
  359.     SetCollideType(mov_colmH, 3);
  360.     
  361.     # Turn off falling debris.
  362.     Sleep(2.5);
  363.     SendMessage(debrisCogH, user1);
  364.     SetPulse(0.0);
  365.     
  366.     # Turn off I collide for a bit.
  367.     SetCollideType(mov_colmI, 0);
  368.  
  369.     Sleep(0.25);
  370.  
  371. # Code for third section of huge room.
  372.     # Turn on falling debris.
  373.     //SendMessage(debrisCogI, user0);
  374.     SetPulse(0.1);
  375.     
  376.     # Drop move blocks.
  377.     MoveToFrame(mov_colmI, 1, 8.0);
  378.     Sleep(0.25);
  379.     PlaySoundThing(sfx_Block, mov_colmJ, 1.0, 5.0, 10.0, 0);
  380.     MoveToFrame(mov_colmJ, 1, 8.0);
  381.     Sleep(0.15);
  382.     
  383.     # Give 3dos collision back after they pass thru geometry.
  384.     SetCollideType(mov_colmI, 3);
  385.     //SetCollideType(mov_colmJ, 3);
  386.     
  387.     # Turn off falling debris.
  388.     Sleep(4.0);
  389.     //SendMessage(debrisCogI, user1);
  390.     SetPulse(0.0);
  391.     SetTimer(rumbleWait); # rumbleWait Code.
  392.     }
  393. # Stop all.
  394. if (GetSenderRef() == finalTrigger)
  395.     {
  396.     StopSound(rumbleChannel, 0); # rumbleWait Code.
  397.     SetPulse(0.0); # rumbleWait Code.
  398.     SetTimer(0); # rumbleWait Code.
  399.     }
  400.  
  401. return;
  402.     
  403. # ........................................................................................
  404. user0:
  405.  
  406. goodToGo = 1;
  407.  
  408. return;
  409.     
  410. # ........................................................................................
  411. user1:
  412.  
  413. shake = 1;
  414. //SetPulse(1.0);
  415.  
  416. SetThingFlags(stat_colmA, 0x80000);
  417. SetThingFlags(stat_colmB, 0x80000);
  418. SetThingFlags(stat_colmC, 0x80000);
  419.  
  420. ClearThingFlags(mov_colmA, 0x80000);
  421. ClearThingFlags(mov_colmB, 0x80000);
  422. ClearThingFlags(mov_colmC, 0x80000);
  423.  
  424. return;
  425.     
  426. # ........................................................................................
  427. timer:
  428.  
  429. SetPulse(0.1);
  430. rumbleChannel = PlaySoundLocal(sndFalling, 1.0, 0, 0x1, 0);
  431.  
  432. return;
  433.     
  434. # ........................................................................................
  435. pulse:
  436.  
  437. if (shake == 3)
  438.     {
  439.     vibe = RandBetween(1, 3);
  440.     if (vibe == 3)
  441.         {
  442.         # Skip this time...
  443.         return;
  444.         }
  445.     }
  446. vibe = RandBetween(1, 4);
  447. if (vibe == 1)
  448.     {
  449.     if (shake == 1)
  450.         {
  451.         posOffset = '-0.008 0.00 -0.002'; #1 was .005x
  452.         angOffset = '0.00 -0.002 0.002';
  453.         }
  454.     if (shake == 2)
  455.         {
  456.         posOffset = '0.01 -0.01 0.005'; #2
  457.         angOffset = '0.005 0.00 -0.005';
  458.         }
  459.     if (shake == 3)
  460.         {
  461.         posOffset = '0.01 0.02 -0.02'; #3
  462.         angOffset = '-0.01 0.01 -0.01';
  463.         }
  464.     }
  465. if (vibe == 2)
  466.     {
  467.     if (shake == 1)
  468.         {
  469.         posOffset = '0.008 -0.005 0.002'; #2 was .005x
  470.         angOffset = '0.002 0.00 -0.002';
  471.         }
  472.     if (shake == 2)
  473.         {
  474.         posOffset = '0.005 0.01 -0.01'; #3
  475.         angOffset = '-0.005 0.005 -0.00';
  476.         }
  477.     if (shake == 3)
  478.         {
  479.         posOffset = '-0.02 0.00 0.02'; #4 was .01x
  480.         angOffset = '0.00 0.00 0.01';
  481.         }
  482.     }
  483. if (vibe == 3)
  484.     {
  485.     if (shake == 1)
  486.         {
  487.         posOffset = '0.005 0.005 -0.005'; #3 was .002x
  488.         angOffset = '-0.002 0.005 -0.005';
  489.         }
  490.     if (shake == 2)
  491.         {
  492.         posOffset = '-0.015 0.00 0.01'; #4 was .01x
  493.         angOffset = '0.00 0.00 0.01';
  494.         }
  495.     if (shake == 3)
  496.         {
  497.         posOffset = '-0.025 0.00 -0.01'; #1 was .02x
  498.         angOffset = '0.00 -0.01 0.01';
  499.         }
  500.     }
  501. if (vibe == 4)
  502.     {
  503.     if (shake == 1)
  504.         {
  505.         posOffset = '-0.002 0.00 0.005'; #4
  506.         angOffset = '0.00 0.00 0.002';
  507.         }
  508.     if (shake == 2)
  509.         {
  510.         posOffset = '-0.01 0.00 -0.005'; #1
  511.         angOffset = '0.00 -0.005 0.005';
  512.         }
  513.     if (shake == 3)
  514.         {
  515.         posOffset = '0.02 -0.02 0.01'; #2
  516.         angOffset = '0.01 0.00 -0.01';
  517.         }
  518.     }
  519. vibe = RandBetween(1, 3);
  520. if (vibe == 1)
  521.     {
  522.     SetPulse(0.05);
  523.     }
  524. if (vibe == 2)
  525.     {
  526.     SetPulse(0.1);
  527.     }
  528. if (vibe == 3)
  529.     {
  530.     SetPulse(0.15);
  531.     }
  532. SetPOVShake(posOffSet, angOffSet, 200.0, 200.0);
  533.  
  534. return;
  535.  
  536. # ........................................................................................
  537. end
  538.